package utils

type DetaultHttpModel struct {
	Status  int         `json:"status" form:"status"`
	Message string      `json:"message" form:"message"`
	Result  interface{} `json:"result" form:"result"`
}

//默认数据
func HTTP_SUCCESS(obj interface{}) DetaultHttpModel {
	model := DetaultHttpModel{Status: 100, Message: "Request Success !", Result: obj}
	return model
}

//数据不存在
func HTTP_ERROR_404(err interface{}) DetaultHttpModel {
	model := DetaultHttpModel{Status: 404, Message: "No Data !", Result: err}
	return model
}

//请求出错
func HTTP_ERROR_503(err interface{}) DetaultHttpModel {
	model := DetaultHttpModel{Status: 503, Message: "Request Error !", Result: err}
	return model
}
